package com.juzi.wopu.service.impl;

import java.util.List;
import java.util.Map;

import com.juzi.wopu.domain.CartSupplier;
import com.juzi.wopu.service.ICartSupplierService;

public class CartSupplierServiceImpl extends BaseServiceImpl<CartSupplier> implements ICartSupplierService{

	@Override
	public void getCartSupplierMap(Map<Long, CartSupplier> map1, Map<String, CartSupplier> map2) {
		// 拿到供应商里面所有的值
		List<CartSupplier> list=BaseDao.getAll(CartSupplier.class);
		/**
		 * 判断如果拿到的供应商不为空就放入代Map里面
		 */
		if(list!=null && list.size()>0){
			if(map1!=null && map2==null){
				for(CartSupplier c:list){
					map1.put(c.getiSupplierId(), c);
				}
			}
			else if(map1==null && map2!=null){
				for(CartSupplier c:list){
					map2.put(c.getsName(), c);
				}
			}
			else if(map1!=null && map2!=null){
				for(CartSupplier c:list){
					map1.put(c.getiSupplierId(), c);
					map2.put(c.getsName(), c);
				}
			}
		}
	}
}
